package leds.ifes.mobilidadeurbana.piloto;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DataBaseHelper extends SQLiteOpenHelper{
	
	public static final int DATABASE_VERSION = 1;
	public static final String DATABASE_NOME = "MobilidadeUrbanaPiloto.db";

	public DataBaseHelper(Context context) {
		super(context, DATABASE_NOME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(TabelaRota.SQL_CREATE_ENTRIES);
		db.execSQL(TabelaLocalizacao.SQL_CREATE_ENTRIES);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL(TabelaLocalizacao.SQL_DELETE_ENTRIES);
		db.execSQL(TabelaRota.SQL_DELETE_ENTRIES);
        onCreate(db);
	}
}